/*
===============================================================================
                           NewStatusNotify plugin

This plugin notifies you when a contact changes his/hers status with a PopUp.
You can customize its look (style of popup, font, text...) and behaviour (the
position in the screen, the time to live, the action on a mouse click).

File name: "common.h"
This file contains:
- definitions,
- structures,
- macros
which can be useful to different modules (example EventNotify) but mainly
useful to me in order to split my Plugin on different files :-)

Written by: Hrk (Luca Santarelli)

Miranda IM can be found here:
http://miranda-icq.sourceforge.net/

Miranda IM plugins and tools can be found here:
http://nortiq.com/miranda/

===============================================================================
*/

#ifndef COMMON_H
#define COMMON_H

#define MAX_STATUSTEXT   36
#define MAX_STANDARDTEXT 36
#define MAX_SKINSOUNDNAME 36
#define MAX_SKINSOUNDDESC 36
//=== Objects =====
//This one is used to easily tie status id, icon, text...
typedef struct
{
	int ID;
	int Icon;
	TCHAR lpzMStatusText[MAX_STATUSTEXT];
	TCHAR lpzFStatusText[MAX_STATUSTEXT];
	TCHAR lpzUStatusText[MAX_STATUSTEXT];
	TCHAR lpzStandardText[MAX_STANDARDTEXT];
	char lpzSkinSoundName[MAX_SKINSOUNDNAME];
	char lpzSkinSoundDesc[MAX_SKINSOUNDDESC];
	char lpzSkinSoundFile[MAX_PATH];
	DWORD dwProtoFlag;
	COLORREF colorBack;
	COLORREF colorText;
} aStatus;

#define Index(ID_STATUS) ID_STATUS - 40071
#define ID_STATUS_MIN	ID_STATUS_OFFLINE
#define ID_STATUS_MAX	ID_STATUS_OUTTOLUNCH

#define byCOLOR_OWN	0x1
#define byCOLOR_WINDOWS	0x2
#define byCOLOR_POPUP	0x3
#define DEFAULT_COLORS	byCOLOR_OWN

//===== Options flags
typedef struct tagMYOPTIONS {
	BYTE Colors;
	//BYTE UseWinColors;
	BYTE UseDullText;
	BYTE ReadAwayMsg;
	BYTE ShowPreviousStatus;
	BYTE TempDisable;
	BYTE AutoDisable;
	BYTE FromOffline;
	BYTE FromOfflinePopup;
	BYTE EnableSounds;
	BYTE EnablePopups;
	BYTE UseSpeaker;
	BYTE AvoidClipping;
	BYTE HiddenContactsToo;
	BYTE Log;
	BYTE UseIndSnd;
	BYTE ShowGroup;
	BYTE BlinkIcon;
	BYTE BlinkIcon_Status;
	BYTE byTimeout;
	int iTimeout;
} MYOPTIONS;

#define DB_READ_SUCCESS		0
#define DB_READ_FAIL		-1

typedef struct tagPLUGINDATA {
	WORD newStatus;
	WORD oldStatus;
	HANDLE hAwayMsgProcess;
	HANDLE hAwayMsgHook;
} PLUGINDATA;
#endif //COMMON_H

/*


#define ListView_GetItemTextA(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
{ LV_ITEMA _ms_lvi;\
  _ms_lvi.iSubItem = iSubItem_;\
  _ms_lvi.cchTextMax = cchTextMax_;\
  _ms_lvi.pszText = pszText_;\
  SNDMSG((hwndLV), LVM_GETITEMTEXTA, (WPARAM)(i), (LPARAM)(LV_ITEM *)&_ms_lvi);\
}

#define ListView_InsertColumnA(hwnd, iCol, pcol) \
    (int)SNDMSG((hwnd), LVM_INSERTCOLUMNA, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN *)(pcol))

*/